# -*- coding: utf-8 -*-            
# @Author : chenliang
# @Time : 2024/10/25 16:31

import pandas as pd
import datetime
from Common.business_common_tool import BusinessCommonTools
from Common.get_sql_object import GetSqlObject
from Common.dingtalk import Ding
from datetime import timedelta
from Common.do_mysql import DoMysql


mysql_source = GetSqlObject.get_instance("PRO")
logistics_line=BusinessCommonTools().get_logistics_line('PRO','广东省',mysql_source)



#组装成excel数据
df1 = pd.DataFrame(logistics_line)


# 指定要导出的Excel文件名
excel_file = f'/File/广东省物流线路报价.xlsx' # 生产环境文件存放地址
#excel_file = f'File/广东省物流线路报价.xlsx'
excel_file_path = f'http://47.116.122.206{excel_file}'

# 使用ExcelWriter对象
with pd.ExcelWriter(excel_file, engine='xlsxwriter') as writer:
    df1.to_excel(writer, sheet_name='物流线路', index=False)


result_string = f"广东省物流线路报价：{excel_file_path}"
print(result_string)

Ding().ding_hami(result_string)





